package com.ly.user_system.enums;


/**
 * 事件枚举
 * 所属类型中的科目
 * 所属类型
 */
public enum EventEnum {
    ROLE("ROLE",null,null,ConsumerType.POD),
    ROLE_CREATE("ROLE_CREATE",Type.CREATE,ROLE,ConsumerType.POD),
    ;
    // 类型
    private final String type;
    // 所属科目
    private final Type subject;
    // 父级类型
    private final EventEnum parentEvent;
    // 消费类型
    private final ConsumerType consumerType;

    EventEnum(String type, Type subject, EventEnum parentEvent, ConsumerType consumerType) {
        this.type = type;
        this.subject = subject;
        this.parentEvent = parentEvent;
        this.consumerType = consumerType;
    }

    public String getType() {
        return type;
    }

    public Type getSubject() {
        return subject;
    }

    public EventEnum getParentEvent() {
        return parentEvent;
    }

    public ConsumerType getConsumerType() {
        return consumerType;
    }

    public enum Type{
        CREATE,
        UPDATE,
        DELETE,
        SELECT,
        CHECK,
    }


    /**
     * 监听器消费类型
     */
    enum ConsumerType{
        POD,
        MQ
    }
}
